<template>
  <div class="goods">
    <!-- 用于存放每一个商品 -->
    <goods-list-item v-for="(item,id) in goods" :key="id" :goodsItem="item"></goods-list-item>
  </div>
</template>

<script>
import GoodsListItem from './GoodsListItem.vue'

export default {
  name: 'GoodsList',
  components: { GoodsListItem },
  props: {
    goods: { //获取所有商品信息
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style scoped>
  .goods {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      padding: 2px;
  }
</style>
